<div class=" am-padding-xs am-padding-top-0">
    <div class="am-panel am-panel-default">
        <div class="am-panel-bd">
            <div class="am-cf">
                <div class="am-fl am-cf">
                    <?php if (!empty($_GET['back_url'])): ?>
                        <a href="<?= base64_decode($_GET['back_url']) ?>" class="am-margin-right-xs am-text-danger"><i
                                    class="am-icon-reply"></i>返回</a>
                    <?php endif; ?>
                    <strong class="am-text-primary am-text-lg"><a
                                href="<?= $label->url(GROUP . '-' . MODULE . '-' . ACTION); ?>"><?= $title; ?></a>
                    </strong> /
                    <small>列表</small>
                </div>
            </div>
            <div class="am-g am-margin-bottom-lg am-g-collapse">
                <div class="am-u-sm-12 am-u-md-6 am-padding-top-xs">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <?php ?>
                            <?php $addUrl = empty($addUrl) ? $label->url(GROUP . '-' . MODULE . '-action', ['back_url' => base64_encode($_SERVER['REQUEST_URI'])]) : $addUrl ?>
                            <a href="<?= $addUrl ?>" class="am-btn am-btn-default am-radius"><span
                                        class="am-icon-plus"></span> 新增</a>
                        </div>
                    </div>
                </div>


                <div class="am-u-sm-12 am-u-md-3">
                </div>
            </div>

            <?php if (!empty($list)): ?>
                <?php foreach ($list as $floor => $item): ?>
                    <div class="am-text-center am-margin-xs">
                        <hr data-am-widget="divider" class="am-margin-0"/>
                        <span style="position: relative;top: -11px;background-color: #ffffff"><?= $label->getFieldOptionToMatch('277', $floor); ?></span>
                    </div>
                    <ul class="unit-ul am-avg-sm-1 am-avg-lg-4 am-thumbnails am-margin-bottom">
                        <?php foreach ($item as $value): ?>
                            <li class="unit-category <?= $value['unit_status'] == 0 ? 'unit-empty' : '' ?>">
                                <h4 class="am-margin-bottom-xs"><?= $value['unit_number'] ?></h4>
                                <p class="am-margin-0">租金：<?= $value['unit_fee'] ?> 元/月</p>
                                <p class="am-margin-0">电费：<?= $value['unit_electric'] ?> 元/度</p>
                                <p class="am-margin-0">水费：<?= $value['unit_water'] ?> 元/度</p>
                                <p class="am-margin-0">状态：<?= $label->getFieldOptionToMatch('273', $value['unit_status']); ?></p>
                                <div class="am-text-right">
                                    <a href="<?= $label->url(GROUP.'-Unit-action', ['id' => $value['unit_id'], 'back_url' => base64_encode($_SERVER['REQUEST_URI'])]) ?>" class="am-btn am-btn-xs am-btn-primary"><i class="am-icon-edit"></i> 编辑</a>
                                    <a href="<?= $label->url(GROUP.'-Unit-fee', ['id' => $value['unit_id'], 'back_url' => base64_encode($_SERVER['REQUEST_URI'])]) ?>" class="am-btn am-btn-xs am-btn-warning"><i class="am-icon-dollar"></i> 房租</a>
                                    <a href="<?= $label->url(GROUP . '-' . MODULE . '-action', array('id' => $label->xss($value["unit_id"]), 'method' => 'DELETE', 'back_url' => base64_encode($_SERVER['REQUEST_URI']))) ?>" class="am-btn am-btn-xs am-btn-danger ajax-click ajax-dialog"  msg="确定删除吗？将无法恢复的！"><i class="am-icon-undo"></i> 删除</a>
                                </div>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                <?php endforeach; ?>
            <?php endif; ?>

        </div>
    </div>
</div>